const ICON_LIST = {
    'icon-start': '\ue778',
    'icon-notch': '\ue621',
    'icon-fx': '\ue601',
    'icon-reply': '\ue602',
    'icon-select': '\ue614',
    'icon-judge': '\ue66a',
    'icon-end': '\ue600'
}

const WIDTH = 200
const HEIGHT = 80
const IN_ANCHOR_POINTS = [[0.5, 0]]
const OUT_ANCHOR_POINTS = [[0.5, 1]]

const list = [
    {
        label: '开始节点',
        name: '触发器',
        isStart: true,
        icon: 'icon-start',
        x: 200,
        y: 100
    },
    {
        label: '填槽节点',
        icon: 'icon-notch'
    },
    {
        label: '函数节点',
        icon: 'icon-fx'
    },
    {
        label: '回复节点',
        icon: 'icon-reply'
    },
    {
        label: '选择节点',
        icon: 'icon-select'
    },
    {
        label: '判断节点',
        icon: 'icon-judge'
    },
    {
        label: '结束节点',
        icon: 'icon-end',
        isEnd: true,
        size: [200, 50]
    }
]

// 添加 锚点 等参数
list.forEach(item => {
    const anchorPoints = []
    if (!item.isStart) {
        anchorPoints.push(...IN_ANCHOR_POINTS)
    }
    if (!item.isEnd) {
        anchorPoints.push(...OUT_ANCHOR_POINTS)
    }

    Object.assign(item, {
        type: 'customNode',
        size: item.size || [WIDTH, HEIGHT],
        iconUnicode: ICON_LIST[item.icon],
        anchorPoints
    })
})

export default list
